source('G:/Git/R-practice/chapter12/chapter12-1.R')
source('G:/Git/R-practice/chapter12/chapter12-2.R')
print(select(diamonds,carat,price))
print(diamonds %>% select(carat,price))
print(diamonds %>% select(c(carat,price)))
print(diamonds %>% select_('carat','price'))
theCols <- c('carat','price')
print(diamonds %>% select_(.dots = theCols))
print(diamonds %>% select(one_of('carat','price')))
print(diamonds[,c('carat','price')])
print(select(diamonds,1,7))
print(diamonds %>% select(1,7))
print(diamonds %>% select(starts_with('c')))
print(diamonds %>% select(ends_with('c')))
print(diamonds %>% select(contains('l')))
print(diamonds %>% select(match('r.+t')))
print(diamonds %>% select(-carat,-price))
print(diamonds %>% select(-c(carat,price)))
print(diamonds %>% select(-1,-7))
print(diamonds %>% select(-c(1,7)))
print(diamonds %>% select_(.dots = c('-catar','-price')))
print(diamonds %>% select(-one_of('carat','price')))
